<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: page_mulit_sort.php 135 2013-09-22 07:30:55Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 135 $
* 	zuletzt geändert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:30:55 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

if(PRODUCT_LIST_FILTER_SORT == 'true') {	
	$multisort_dropdown = draw_form('multisort', $listing->setExternalLink, 'GET')."\n";
	
	reset($_GET);
	
	if(MODULE_SEO_URL_INDEX_STATUS == 'True') {
		unset($_GET['cPath']);
		unset($_GET['tag']);
		unset($_GET['keywords']);
		unset($_GET['brand']);
	}
		
	while(list($key, $value) = each($_GET)) {
		if($key != 'multisort') {
			if(is_array($value)) {
				while(list($sub_key, $sub_value) = each($value))
					$multisort_dropdown .= draw_hidden_field($key.'[]', $sub_value);
			} elseif(!empty($value))
				$multisort_dropdown .= draw_hidden_field($key, $value)."\n";
		}
	}
	
	$options   = array(array('text' => MULTISORT_STANDARD));
	$check_special = $db->db_query("SELECT specials_id FROM ".TABLE_SPECIALS);
	if($check_special->_numOfRows)
		$options[] = array('id' => 'specialprice', 'text' => MULTISORT_SPECIALS_DESC);
	$options[] = array('id' => 'new_desc', 'text' => MULTISORT_NEW_DESC);
	$options[] = array('id' => 'new_asc', 'text' => MULTISORT_NEW_ASC);
	$options[] = array('id' => 'price_asc', 'text' => MULTISORT_PRICE_ASC);
	$options[] = array('id' => 'price_desc', 'text' => MULTISORT_PRICE_DESC);
	$options[] = array('id' => 'name_asc', 'text' => MULTISORT_ABC_AZ);
	$options[] = array('id' => 'name_desc', 'text' => MULTISORT_ABC_ZA);
	
	$multisort_dropdown .= draw_pull_down_menu('multisort', $options, $_GET['multisort'], 'onchange="this.form.submit()"')."\n";
	$multisort_dropdown .= '</form>'."\n";
	
	$module_smarty->assign('MULTISORT_DROPDOWN', '<li class="page_multisort">'.$multisort_dropdown.'</li>');
}
?>